/*
 Formalize - version 1.2

 Note: This file depends on the jQuery library.

 This version of Formalize, "jquery.formalize.legacy.js"
 is intended for use with jQuery version 1.4, and exists
 because Drupal 7 ships with jQuery 1.4.4. When you are
 starting a new project with a current version of jQuery,
 you should simply use the "jquery.formalize.js" instead.
 */

// Module pattern:
// http://yuiblog.com/blog/2007/06/12/module-pattern
var FORMALIZE = (function($, window, document, undefined) {
    // Internet Explorer detection.
    function IE(version) {
        var b = document.createElement('b');
        b.innerHTML = '<!--[if IE ' + version + ']><br><![endif]-->';
        return !!b.getElementsByTagName('br').length;
    }

    // Private constants.
    var PLACEHOLDER_SUPPORTED = 'placeholder' in document.createElement('input');
    var AUTOFOCUS_SUPPORTED = 'autofocus' in document.createElement('input');
    var IE6 = IE(6);
    var IE7 = IE(7);

    // Expose innards of FORMALIZE.
    return {
        // FORMALIZE.go
        go: function() {
            var i, j = this.init;

            for (i in j) {
                j.hasOwnProperty(i) && j[i]();
            }
        },
        // FORMALIZE.init
        init: {
            // FORMALIZE.init.disable_link_button
            disable_link_button: function() {
                $(document.documentElement).delegate('a.button_disabled', 'click', function() {
                    return false;
                });
            },
            // FORMALIZE.init.full_input_size
            full_input_size: function() {
                if (!IE7 || !$('textarea, input.input_full').length) {
                    return;
                }

                // This fixes width: 100% on <textarea> and class="input_full".
                // It ensures that form elements don't go wider than container.
                $('textarea, input.input_full').wrap('<span class="input_full_wrap"></span>');
            },
            // FORMALIZE.init.ie6_skin_inputs
            ie6_skin_inputs: function() {
                // Test for Internet Explorer 6.
                if (!IE6 || !$('input, select, textarea').length) {
                    // Exit if the browser is not IE6,
                    // or if no form elements exist.
                    return;
                }

                // For <input type="submit" />, etc.
                var button_regex = /button|submit|reset/;

                // For <input type="text" />, etc.
                var type_regex = /date|datetime|datetime-local|email|month|number|password|range|search|tel|text|time|url|week/;

                $('input').each(function() {
                    var el = $(this);

                    // Is it a button?
                    if (this.getAttribute('type').match(button_regex)) {
                        el.addClass('ie6_button');

                        /* Is it disabled? */
                        if (this.disabled) {
                            el.addClass('ie6_button_disabled');
                        }
                    }
                    // Or is it a textual input?
                    else if (this.getAttribute('type').match(type_regex)) {
                        el.addClass('ie6_input');

                        /* Is it disabled? */
                        if (this.disabled) {
                            el.addClass('ie6_input_disabled');
                        }
                    }
                });

                $('textarea, select').each(function() {
                    /* Is it disabled? */
                    if (this.disabled) {
                        $(this).addClass('ie6_input_disabled');
                    }
                });
            },
            // FORMALIZE.init.autofocus
            autofocus: function() {
                if (AUTOFOCUS_SUPPORTED || !$(':input[autofocus]').length) {
                    return;
                }

                var el = $('[autofocus]')[0];

                if (!el.disabled) {
                    el.focus();
                }
            },
            // FORMALIZE.init.placeholder
            placeholder: function() {
                if (PLACEHOLDER_SUPPORTED || !$(':input[placeholder]').length) {
                    // Exit if placeholder is supported natively,
                    // or if page does not have any placeholder.
                    return;
                }

                FORMALIZE.misc.add_placeholder();

                $(':input[placeholder]').each(function() {
                    // Placeholder obscured in older browsers,
                    // so there's no point adding to password.
                    if (this.type === 'password') {
                        return;
                    }

                    var el = $(this);
                    var text = el.attr('placeholder');

                    el.focus(function() {
                        if (el.val() === text) {
                            el.val('').removeClass('placeholder_text');
                        }
                    }).blur(function() {
                        FORMALIZE.misc.add_placeholder();
                    });

                    // Prevent <form> from accidentally
                    // submitting the placeholder text.
                    el.closest('form').submit(function() {
                        if (el.val() === text) {
                            el.val('').removeClass('placeholder_text');
                        }
                    }).bind('reset', function() {
                        setTimeout(FORMALIZE.misc.add_placeholder, 50);
                    });
                });
            }
        },
        // FORMALIZE.misc
        misc: {
            // FORMALIZE.misc.add_placeholder
            add_placeholder: function() {
                if (PLACEHOLDER_SUPPORTED || !$(':input[placeholder]').length) {
                    // Exit if placeholder is supported natively,
                    // or if page does not have any placeholder.
                    return;
                }

                $(':input[placeholder]').each(function() {
                    // Placeholder obscured in older browsers,
                    // so there's no point adding to password.
                    if (this.type === 'password') {
                        return;
                    }

                    var el = $(this);
                    var text = el.attr('placeholder');

                    if (!el.val() || el.val() === text) {
                        el.val(text).addClass('placeholder_text');
                    }
                });
            }
        }
    };
// Alias jQuery, window, document.
})(jQuery, this, this.document);

// Automatically calls all functions in FORMALIZE.init
jQuery(document).ready(function() {
    FORMALIZE.go();
});;
/**
 * @todo
 */

Drupal.omega = Drupal.omega || {};

(function($) {
  /**
   * @todo
   */
  var current;
  var previous;
  
  /**
   * @todo
   */
  var setCurrentLayout = function (index) {
    index = parseInt(index);
    previous = current;
    current = Drupal.settings.omega.layouts.order.hasOwnProperty(index) ? Drupal.settings.omega.layouts.order[index] : 'mobile';

    if (previous != current) {      
      $('body').removeClass('responsive-layout-' + previous).addClass('responsive-layout-' + current);      
      $.event.trigger('responsivelayout', {from: previous, to: current});
    }
  };
  
  /**
   * @todo
   */
  Drupal.omega.getCurrentLayout = function () {
    return current;
  };
  
  /**
   * @todo
   */
  Drupal.omega.getPreviousLayout = function () {
    return previous;
  };
  
  /**
   * @todo
   */
  Drupal.omega.crappyBrowser = function () {
    return $.browser.msie && parseInt($.browser.version, 10) < 9;
  };
  
  /**
   * @todo
   */
  Drupal.omega.checkLayout = function (layout) {
    if (Drupal.settings.omega.layouts.queries.hasOwnProperty(layout) && Drupal.settings.omega.layouts.queries[layout]) {
      var output = Drupal.omega.checkQuery(Drupal.settings.omega.layouts.queries[layout]);
      
      if (!output && layout == Drupal.settings.omega.layouts.primary) {
        var dummy = $('<div id="omega-check-query"></div>').prependTo('body');       

        dummy.append('<style media="all">#omega-check-query { position: relative; z-index: -1; }</style>');
        dummy.append('<!--[if (lt IE 9)&(!IEMobile)]><style media="all">#omega-check-query { z-index: 100; }</style><![endif]-->');
        
        output = parseInt(dummy.css('z-index')) == 100;

        dummy.remove();
      }
      
      return output;
    }

    return false;
  };
  
  /**
   * @todo
   */
  Drupal.omega.checkQuery = function (query) {
    var dummy = $('<div id="omega-check-query"></div>').prependTo('body');       
    
    dummy.append('<style media="all">#omega-check-query { position: relative; z-index: -1; }</style>');
    dummy.append('<style media="' + query + '">#omega-check-query { z-index: 100; }</style>');

    var output = parseInt(dummy.css('z-index')) == 100;
    
    dummy.remove();

    return output;
  };
  
  /**
   * @todo
   */
  Drupal.behaviors.omegaMediaQueries = {
    attach: function (context) {
      $('body', context).once('omega-mediaqueries', function () {
        var primary = $.inArray(Drupal.settings.omega.layouts.primary, Drupal.settings.omega.layouts.order);
        var dummy = $('<div id="omega-media-query-dummy"></div>').prependTo('body');

        dummy.append('<style media="all">#omega-media-query-dummy { position: relative; z-index: -1; }</style>');
        dummy.append('<!--[if (lt IE 9)&(!IEMobile)]><style media="all">#omega-media-query-dummy { z-index: ' + primary + '; }</style><![endif]-->');

        for (var i in Drupal.settings.omega.layouts.order) {
          dummy.append('<style media="' + Drupal.settings.omega.layouts.queries[Drupal.settings.omega.layouts.order[i]] + '">#omega-media-query-dummy { z-index: ' + i + '; }</style>');
        }

        $(window).bind('resize.omegamediaqueries', function () {
          setCurrentLayout(dummy.css('z-index'));
        }).load(function () {
          $(this).trigger('resize.omegamediaqueries');
        });
      });
    }
  };
})(jQuery);;
/**
 * @todo
 */

(function($) {
  /**
   * @todo
   */
  Drupal.behaviors.omegaEqualHeights = {
    attach: function (context) {
      $('body', context).once('omega-equalheights', function () {
        $(window).bind('resize.omegaequalheights', function () {
          $($('.equal-height-container').get().reverse()).each(function () {
            var elements = $(this).children('.equal-height-element').css('height', '');
            
            if (!Drupal.behaviors.hasOwnProperty('omegaMediaQueries') || Drupal.omega.getCurrentLayout() != 'mobile') {
              var tallest = 0;

              elements.each(function () {    
                if ($(this).height() > tallest) {
                  tallest = $(this).height();
                }
              }).each(function() {
                if ($(this).height() < tallest) {
                  $(this).css('height', tallest);
                }
              });
            }
          });
        }).load(function () {
          $(this).trigger('resize.omegaequalheights');
        });
      });
    }
  };
})(jQuery);;
/**
 * Created by Sfer23 on 05.08.2015.
 */

jQuery(function($){
    if($('.page-missing .pdf-icon').length){
		$('.page-missing .pdf-icon').prepend('Click to print');
    }
    $('#block-menu-menu-top-menu .content').prepend('<span class="opener">Menu&nbsp; <span class="icon-menu"></span>');
    $('#block-menu-menu-top-menu .opener').click(function(){
        $('#block-menu-menu-top-menu .content>ul.menu').slideToggle();
    });
    $('#block-menu-menu-top-menu .content>ul>li.expanded>a').click(function(){
        $(this).toggleClass('hover');
        return false;
    });
    $('#block-block-2 .content').prepend('<div class="opener"><span>Go to...</span><div class="selector-down"></div></div>');
    $('#block-block-2 .opener').click(function(){
        $('#block-block-2 .content>ul').slideToggle();
    });
    $('.view-shop-categories-home .shop-category a').each(function(){
        $(this).html($(this).parent().find('.item').detach().html());
    });
    $('.view-pethub-uc-catalog .add_to_cart').click(function(){
        $(this).parent().find('form').submit();
        return false;
    });
    if($('.table-subscribe-control table tbody tr td form input').length){
      $(document).on('change','.table-subscribe-control table tbody tr td form input',function(){
            $(this).parents('form').submit();
      });
    }
});

Drupal.behaviors.ucCollapseBlock = {
    attach: function(context) {
        jQuery('.cart-block-title-bar:not(.ucCollapseBlock-processed)', context).addClass('ucCollapseBlock-processed').click(
            function() {
                var $items = jQuery('.cart-block-items').toggleClass('collapsed');
                jQuery('#block-uc-cart-cart .content').toggleClass('open');
                jQuery('.cart-block-arrow').toggleClass('arrow-down', $items.hasClass('collapsed'));
            }
        );
    }
};
